<div class="bjui-pageContent">
<form action="{:U('save_menu')}" data-callback="dialogFormCall" data-toggle="validate" data-alertmsg="false" class="dialogForm">
<input type="hidden" name="id" value="{$va.id}">
<div class="form-group">
    <label class="x100">一级菜单:</label>
    <select name="parent_id" data-toggle="selectpicker">
        <option value="">无</option>
        <volist name="res" id="ro">
        <option value="{$ro.id}" <if condition="$va['parent_id'] eq $ro['id']">selected="selected"</if>>{$ro.name}</option>
        </volist>
    </select>
</div>
<div class="form-group">
    <label class="x100">菜单名称:</label>
    <input type="text" name="name" data-rule="required" value="{$va.name}"/>
    <span class="text-warning">最多可创建3个一级菜单,每个一级菜单可创建5个二级菜单</span>
</div>
<div class="form-group">
    <label class="x100">动作:</label>
    <select name="action" data-toggle="selectpicker" class="motion">
        <option value="0">无动作</option>
        <option value="1" <if condition="$va['action'] eq '1'">selected="selected"</if>>推送自定义文字</option>
        <option value="2" <if condition="$va['action'] eq '2'">selected="selected"</if>>推送站内素材</option>
        <option value="3" <if condition="$va['action'] eq '3'">selected="selected"</if>>跳转URL</option>
    </select>
</div>
<div class="sendtype2 sendt" style="display: none;">
    <div class="form-group typeradio">
        <label class="x100">类型:</label>
        <input type="radio" name="status" id="weltype1" value="1" data-toggle="icheck" data-label="文本"  <if condition="$va['status'] eq '1' or $va eq null">checked</if>  />
        <input type="radio" name="status" id="weltype2" value="2" data-toggle="icheck" data-label="图文"  <eq name="va['status']" value="2">checked</eq>/>
        <input type="radio" name="status" id="weltype3" value="3" data-toggle="icheck" data-label="语音"  <eq name="va['status']" value="3">checked</eq> />
        <input type="radio" name="status" id="weltype4" value="4" data-toggle="icheck" data-label="视频"   <eq name="va['status']" value="4">checked</eq>/>
        <input type="radio" name="status" id="weltype5" value="5" data-toggle="icheck" data-label="图片"   <eq name="va['status']" value="5">checked</eq>/>
    </div>
    <div <if condition="$va['status'] eq '1' or $va eq null">class="form-group typesel active"<else/>class="form-group typesel"</if>>
        <label class="x100">选择文本:</label>
        <input type="hidden" name="text_id" value="{$va.status_id}" />
        <input type="text" name="text_show" class="w400" data-id="textup" data-title="文本选择"  data-toggle="lookup" data-url="{:U('Wx/text', array('type'=>1))}" data-width="800" data-height="500" />
    </div>
    <div <eq name="va['status']" value="2">class="form-group typesel active"<else/>class="form-group typesel"</eq>>
        <label class="x100">选择图文:</label>
        <input type="hidden" name="imgtxt_id" id="" value="{$va.status_id}" />
        <input type="text" name="imgtxt_show" value="{$va.status_name}" class="w400" data-id="imgtxtup" data-title="图文选择"  data-toggle="lookup" data-url="{:U('Wx/imgtxt', array('type'=>2))}" data-width="800" data-height="500" />
        <span class="text-warning">注意:如果选择多个图文信息,系统会自动组合为多图文</span>
    </div>
    <div <eq name="va['status']" value="3">class="form-group typesel active"<else/>class="form-group typesel"</eq>>
        <label class="x100">选择语音:</label>
        <input type="hidden" name="voice_id"  value="{$va.status_id}"/>
        <input type="text" name="voice_show" value="{$va.status_name}" class="w400" data-id="textup" data-title="语音选择"  data-toggle="lookup" data-url="{:U('Wx/voice', array('type'=>1))}" data-width="800" data-height="500" />
    </div>
    <div <eq name="va['status']" value="4">class="form-group typesel active"<else/>class="form-group typesel"</eq>>
        <label class="x100">选择视频:</label>
        <input type="hidden" name="video_id" value="{$va.status_id}"/>
        <input type="text" name="video_show" value="{$va.status_name}" class="w400" data-id="textup" data-title="视频选择"  data-toggle="lookup" data-url="{:U('Wx/video', array('type'=>1))}" data-width="800" data-height="500" />
    </div>
    <div <eq name="va['status']" value="5">class="form-group typesel active"<else/>class="form-group typesel"</eq>>
        <label class="x100">选择图片:</label>
        <input type="hidden" name="image_id" value="{$va.status_id}"/>
        <input type="text" name="image_show" value="{$va.status_name}" class="w400" data-id="textup" data-title="图片选择"  data-toggle="lookup" data-url="{:U('Wx/image', array('type'=>1))}" data-width="800" data-height="500" />
    </div>
</div>
<div class="sendtype1 sendt" style="display: none;">
    <label class="x100">选择关建词:</label>
    <input type="hidden" name="keyword_id"  />
    <input type="text" name="keyword_name" class="w400" data-id="textup" data-title="选择关建词"  data-toggle="lookup" data-url="{:U('Wx/autoreply', array('type'=>1))}" data-width="800" data-height="500" />
</div>
<div class="sendtype3 sendt" style="display: none;">
    <label class="x100">URL:</label>
    <input type="text" name="url" class="w400" value="{$va.url}"/>
    <span>注:必须要已http开头</span>
</div>
<div class="form-group">
    <label class="x100">权重:</label>
    <input type="text" name="sort" data-toggle="spinner" value="{$va.sort}" data-min="0" data-step="1" data-rule="integer" class="w100"/>
    
</div>
</form>
</div>
<script>
    var type = {$va.action|default='0'};
    $(function () {
    	type && $('.sendt').hide() && $('.sendtype' + type).show();
        $('.typeradio input[type=radio]').on('ifChanged', function () {
            $('.typesel').removeClass('active').eq((this.value-1)).addClass('active');
            $('.typesel').eq((this.value-1)).find("input[type='hidden']").val('');
            $('.typesel').eq((this.value-1)).find("input[type='text']").val('');
        });
        $('.motion').change(function () {
        	
            $('.sendt').hide();
            $('.sendtype'+this.value).show();

        });
        $('.selty').change(function () {
            $('.keyinput').hide();
            if( this.value == 1 ){
                $('.keyw').show();
            }else if(this.value == 2){
                $('.keyurl').show();
            }
        });
        
    })
</script>
<include file="Common/footer" ftype="save" />